package com.akuhome.resource.enums;

import com.akuhome.resource.enums.mapper.CodeBasedEnum;
import com.akuhome.resource.util.CodeEnumUtil;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonValue;

public enum NeedType implements CodeBasedEnum {
    ACC_NEED(1),CLASSROOM_NEED(2),FOOD_NEED(3);

    private final Integer value;

    NeedType(Integer v){
        this.value = v;
    }
    @JsonValue
    public Integer getValue() {
        return value;
    }

    @JsonCreator
    public static NeedType valueOf(Integer value){
        return CodeEnumUtil.codeOf(NeedType.class,value);
    }

    @Override
    public Integer getCode() {
        return getValue();
    }
}
